<?php
/**
 * Created by PhpStorm.
 * User: 44766
 * Date: 2018-11-15
 * Time: 17:22
 */

namespace App\Services\CrawlerService;


use App\Models\Crawler;
use App\Services\CrawlerService\driver\Xinxin21ccnnDriver;

class CrawlerQueue
{
    protected $driver;
    protected $url;

    public function __construct($url)
    {
        /** @var Xinxin21ccnnDriver $server */
//        $md5=md5($url);
//        $crawler=Crawler::whereMd5($md5)->first();
//        if(!$crawler instanceof Crawler){
//            $crawler=new Crawler();
//            $crawler->url=$url;
//            $crawler->md5=$md5;
//            $crawler->save();
//        }
//        if($crawler->grabbed_at){
//           return false;
//        }
//        $server = new $driver();
//        $server->getDetail($url)->save();
//        $crawler->grabbed_at=now();
//        $crawler->save();
    }
}